package com.pubinfo.passbook.common.model.http.engine;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * 计算单元参数插槽声明
 *
 * @author zhouch
 * @date 2021/12/14 16:26
 */
@Data
@ApiModel("參數插槽")
public class ComputeParamSlot {

    @ApiModelProperty("参数名称")
    @NotBlank(message = "参数名称不能为空")
    private String name;

    /**
     * {@link com.pubinfo.passbook.engine.constants.ComputeResultType}
     */
    @ApiModelProperty("参数返回值类型")
    @NotBlank(message = "参数返回值类型不能为空")
    private String type;


    public static ComputeParamSlot of(String name, String type) {
        ComputeParamSlot slot = new ComputeParamSlot();
        slot.setName(name);
        slot.setType(type);

        return slot;
    }

}
